import request from '@/utils/request'

//获取消息
export function getMessageApi(data) {
  console.log(data)
  return request({
    url: `/api-pageFactory/sxjsc-app/qianFan/getAnswerString`,
    method: 'post',
    data
  })
}
//获取消息2
export function getMessageApi2(data) {
  console.log(data)
  return request({
    url: `/api-pageFactory/sxjsc-app/qianFan/getAnswerString22`,
    method: 'post',
    responseType: 'stream',
    data
  })
}
//保存记录接口
export function saveLogApi(data) {
  console.log(data)
  return request({
    url: `/api-pageFactory/sxjsc-app/zhipuAI/saveLog`,
    method: 'post',
    data
  })
}
//详情接口
export function selectByUuidApi(data) {
  console.log(data)
  return request({
    url: `/api-pageFactory/sxjsc-app/zhipuAI/selectByUuid`,
    method: 'post',
    data
  })
}
//列表接口
export function selectListApi(data) {
  console.log(data)
  return request({
    url: `/api-pageFactory/sxjsc-app/zhipuAI/selectList`,
    method: 'post',
    data
  })
}

//获取token
export function getTokenApi(data) {
  console.log(data)
  return request({
    url: 'zs/oauth/2.0/token?grant_type=client_credentials&client_id=' + AK + '&client_secret=' + SK,
    method: 'post',
    data
  })
}
const AK = 'fbIup8UPnS8LJKJKBSSOXnh2'
const SK = 'bs1SjK5MDrtKtN3iiR2xiUz0Eoij16ks'
//发送消息Api
export function getMessageNewApi(data) {
  console.log(data)
  return request({
    url: '/zs/v2/chat/completions',
    method: 'post',
    headers: {
      "Authorization" :"Bearer FevbguYaIyGiWSGaBhVx:PPUhJDleYTSPMjDsspaw",  // 请替换XXXXXXXXXX为您的 APIpassword, 获取地址：https://console.xfyun.cn/services/bmx1
      "content-type"  : "application/json"
  },
    data: data
  })
}
